//package com.liwen.service.mq;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
//import com.alibaba.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
//import com.alibaba.rocketmq.client.consumer.listener.MessageListenerOrderly;
//import com.alibaba.rocketmq.common.message.MessageExt;
//import com.liwen.service.BaseSupport;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
//import java.util.List;
//
//@Component
//public class OrderConsumer extends BaseSupport implements MessageListenerOrderly {
//
//    private static Logger log = LoggerFactory.getLogger(OrderConsumer.class);
//
//    @Override
//    public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) {
//        try {
//            for (MessageExt ext : msgs) {
//                String json = new String(ext.getBody());
//                // 解析消息信息
//                log.info("收到消息=json:{}", json);
//                JSONObject object = JSON.parseObject(json, JSONObject.class);
//                if (null == object) {
//                    log.error("消息异常=json:{}", json);
//                    continue;
//                }
//                String aa = object.getString("aa");
//                log.info(aa);
//
//            }
//
//        } catch (Exception e) {
//            log.error("消息消费", e);
//        }
//        return ConsumeOrderlyStatus.SUCCESS;
//    }
//}
